﻿@{
    ViewBag.Title = "用户登录";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section scripts{
    <script src="~/Scripts/jquery.validate11.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#loginForm").validate({
                rules:{
                    password: { required: true },
                    email: {
                        required: true,
                        email: true
                    }
                },
                messages:{
                    password: { required: "请输入密码" },
                    email: {
                        required: "请输入电子邮件地址",
                        email: "请输入正确的电子邮件地址"
                    }
                },
                errorPlacement:function(error, element){
                    error.appendTo(element.next("span"));
                }
            });
        });
    </script>
}

<div class="smallpageheader">
    <div class="wrapper">
        <ul class="ulSpecification">
            <li><h1>建立您的账户</h1></li>
            <li><p>注册为我们的用户，您会得到更优质，更有价值的服务。注册为我们的用户，您会得到更优质，更有价值的服务。注册为我们的用户，您会得到更优质，更有价值的服务。</p></li>
        </ul>
    </div>
</div>
<div class="pagewrapper">
    <div class="wrapper">
        @using (Html.BeginForm( "Login", "Home", FormMethod.Post, new { id="loginForm" }))
        {
            <div id="divLoginForm">
                <ul>
                    <li>
                        <span>电子邮件:</span>
                    </li>
                    <li>
                        <input type="text" name="email" id="tenantName" />
                        <span class="errMsg"></span>
                    </li>
                    <li style="margin-top:30px;">
                        <span>密码:</span>
                    </li>
                    <li style="margin-top:30px;">
                        <input type="password" name="password" />
                        <span class="errMsg"></span>
                    </li>
                </ul>
                <input id="loginSubmit" type="submit" value="登陆" />
                @if (ViewBag.ErrorMessage != null)
                {
                    <div class="loginError">@ViewBag.ErrorMessage</div>
                }
            </div>
            <input type="hidden" name="returnUrl" value="@ViewBag.ReturnUrl" />
        }
    </div>
</div>
